
public class HeightDiffFeature implements Feature {

	@Override
	public double computeScore(Stateview s) {
		int[] top = s.getTop();
		double variance = 0;
		double sum = 0;
		
		// compute the mean
		for(int col=0; col<top.length; col++) {
			sum += top[col];
		}
		
		double mean = sum/top.length;
		
		for(int col=0; col<top.length; col++) {
			variance += Math.pow((top[col]-mean),2);
		}
		
		
		return variance * -2;
	}

}
